import {CLEAR_BUSINESS, PUSH_SEARCH} from "store/search";

export const PUSH_URl = 'PUSH_URl' //添加路由
export const DEL_URl = 'DEL_URl' //添加路由
export const UPDATA_URl = 'UPDATA_URl' //添加路由
export const CLEAR_URl = 'CLEAR_URl' //清空路由


export const UPDATE_ENVIRONMENT = 'UPDATE_ENVIRONMENT' //清空路由


export default{
  state:{
    arr:[],
    isNewNative: false
  },
  mutations:{
    [PUSH_URl](state, data) {    //  门店
      let arr = state.arr
      arr.push(data)
      state = {arr:arr}
      arr = null
    },
    [DEL_URl](state, data) {    //  门店
      let arr = state.arr
      arr.pop()
      state = {arr:arr}
      arr = null
    },
    [UPDATA_URl](state, data) {    //  门店
      let arr = state.arr
      arr.pop()
      arr.push(data)
      state = {arr:arr}
      arr = null
    },
    [CLEAR_URl](state, data) {    //  门店
      let arr = []
      state = {arr:arr}
      arr = null
    },
      [UPDATE_ENVIRONMENT](state, data){
      state.isNewNative = data
      }
  },
  actions:{
    [PUSH_URl]({commit}, data) {
      commit(PUSH_URl, data)
    },
    [DEL_URl]({commit}, data) {
      commit(DEL_URl, data)
    },
    [UPDATA_URl]({commit}, data) {
      commit(UPDATA_URl, data)
    },
    [CLEAR_URl]({commit}, data) {
      commit(CLEAR_URl, data)
    },
      [UPDATE_ENVIRONMENT]({commit}, data) {
      commit(UPDATE_ENVIRONMENT, data)
    },
  }
}